import request from '@/utils/request'

/**
 * @description 列表
 * @param data
 * @returns
 */
export const getProblemListApi: IGetProblemListApi = function (params) {
  return request.get('htscrm/wenti/list', { params });
};

/**
 * @description 所有数据
 * @param params
 * @returns
 */
export const getProblemAllApi: IGetProblemAllApi = function(params) {
  return request.get(`htscrm/wenti/all`, { params })
}

/**
 * @description 详情
 * @param data
 * @returns
 */
export const getProblemDetailApi: IGetProblemDetailApi = function (id) {
  return request.get(`htscrm/wenti/info/${id}`);
};

/**
 * @description 添加
 * @param data
 * @returns
 */
export const addProblemApi: IAddProblemApi = function (data) {
  return request.post('htscrm/wenti/add', data);
};

/**
 * @description 编辑
 * @param data
 * @returns
 */
export const updateProblemApi: IUpdateProblemApi = function (data) {
  return request.post(`htscrm/wenti/edit/${data.id}`, data);
};

/**
 * @description 删除
 * @param data
 * @returns
 */
export const deleteProblemApi: IDeleteProblemApi = function (id) {
  return request.post(`htscrm/wenti/del/${id}`);
};

/**
 * @description 批量删除
 * @param data
 * @returns
 */
export const batchDeleteProblemApi: IBatchDeleteProblemApi = function (ids) {
  return request.post(`htscrm/wenti/delete`, {ids});
};
